/* Transition time for hover effects */
@transitionTime: 0.15s;

#webmaker-preview-holder-pane {
  border: 0;
}

.main-nav {
  margin-left: 16px;
  position: relative;
  top: 5px;

  a {
    display: inline-block;
    font-size: 16px;
    padding-bottom: 4px;
    font-weight: 600;
    text-decoration: none;
    color: white;
    margin: 0 20px;
    opacity: 0.6;
    border-bottom: solid 2px transparent;

    &:hover {
      border-bottom: solid 2px rgba(255, 255, 255, 0.5);
    }

    &.selected {
      opacity: 1;
      border-bottom: solid 2px white;
    }
  }
}

.container-flex {
  display: -webkit-inline-flex;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-align-content: space-between;
  align-content: space-between;
}

.navbar-thimble {
  color: rgba(255, 255, 255, 0.65);
  width: 100%;
  height: 60px;
  margin-top: 66px;

  .navbar-logo-container {
    position: relative;
    top: 17px;
    left: -3px;

    .thimble-logo-full {
      width: 115px;
    }

    &:hover {
      transform: scale(1.05);
    }

    &:active {
      transform: scale(0.95);
    }
  }

  .thimble-logo {
    height: 30px;
    width: 28px;
  }

  #navbar-project-title {
    color: white;
    font-size: 1.1em;
    padding: 5px 10px;
    border-radius: 1px;
    display: inline-block;
    .icon;

    img.icon-edit {
      width: 15px;
      opacity: 0.35;
      position: relative;
      margin-left: 4px;
      top: 1px;
      filter: alpha(opacity=35);
    }

    #project-title {
      background-color: transparent;
      border: none;
    }

    input#project-title {
      width: 350px;
    }

    span#project-title {
      text-overflow: ellipsis;
      overflow: hidden;
      max-width: 350px;
      display: inline-block;
      vertical-align: bottom;
    }

    #project-rename-save {
      display: none;
      font-size: 0.9em;
      background-color: white;
      color: #55986c;
      text-decoration: none;
      padding: 3px 8px 4px;
      border-bottom: 1px solid #b9d6c3;
      border-radius: 2px;
      position: relative;
      top: -2px;
      opacity: 0.9;
      filter: alpha(opacity=90);
    }

    #project-rename-save:hover {
      opacity: 1;
      filter: alpha(opacity=100);
    }

    #project-rename-save:active {
      opacity: 1;
      filter: alpha(opacity=100);
      position: relative;
      top: -1px;
      border-width: 0;
    }

    #project-rename-save.disabled {
      opacity: 0.5;
    }

    .text-input {
      outline: none;
      border-bottom: 1px solid !important;
      font-size: 1em;
      margin-right: 3px;
    }
  }

  #navbar-project-title.shadow:hover {
    background-color: rgba(0, 0, 0, 0.1);

    img.icon-edit {
      opacity: 1;
      filter: alpha(opacity=100);
    }

    cursor: pointer;
  }

  .nav-chunk {
    margin-left: 5px;
    height: 62px;
    .flex-vertical-align;
  }

  .nav-link {
    opacity: 0.65;
    color: white;
    .transition;

    &:hover {
      opacity: 1;
    }
  }

  #navbar-help {
    margin-right: 15px;
  }

  #navbar-help:hover {
    opacity: 1;
    filter: alpha(opacity=100);
  }

  #navbar-publish {
    margin: 0;
  }

  #navbar-publish-button {
    background-color: white;
    color: #55986c;
    text-decoration: none;
    padding: 6px 10px 6px 9px;
    border-bottom: 2px solid #b9d6c3;
    border-radius: 2px;
    position: relative;
    font-weight: 400;
    margin-right: 15px;
    top: 0;
    filter: alpha(opacity=90);
    opacity: 0.9;
    box-sizing: border-box;
    .transition;
    .icon;

    img.icon-publish {
      width: 15px;
      vertical-align: middle;
      position: relative;
      top: -2px;
      margin-right: 6px;
    }

    &:hover {
      opacity: 1;
      filter: alpha(opacity=100);
    }

    &:active {
      opacity: 1;
      filter: alpha(opacity=100);
      position: relative;
      top: 2px;
      border: none;
    }

    &::after {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: -2px;
    }

    &:active::after {
      top: -3px;
      left: 0;
      right: 0;
      bottom: 1px;
    }
  }

  #navbar-login {
    padding-right: 0;
    border-right: none;
    .transition;

    &.signed-in {
      padding-right: 15px;
    }
  }

  #navbar-locale {
    .flex-vertical-align;
  }

  #navbar-left {
    white-space: nowrap;
    margin-left: 20px;
    .flex-vertical-align;
  }

  #navbar-right {
    white-space: nowrap;
    margin-left: auto;
    float: right;
    .flex-vertical-align;
  }
}

/* Mix-ins */
.icon {
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.transition {
  -webkit-transition: @transitionTime;
  -moz-transition: @transitionTime;
  -ms-transition: @transitionTime;
  -o-transition: @transitionTime;
  transition: @transitionTime;
  transition-timing-function: ease-out;
}

.transition-only-opacity {
  -webkit-transition: opacity @transitionTime ease-in-out;
  -moz-transition: opacity @transitionTime ease-in-out;
  -ms-transition: opacity @transitionTime ease-in-out;
  -o-transition: opacity @transitionTime ease-in-out;
  transition: opacity @transitionTime ease-in-out;
}

/* Link for login section */
a.navbar-login {
  color: white;
  text-decoration: none;
  font-weight: normal;
}

a.navbar-login:hover {
  .transition;

  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid;
}

/* Logged in menu */
#navbar-anonymous {
  position: relative;
  padding: 7px 9px;
  padding-right: 0;
  border-radius: 1px 0 0 1px;
  margin-right: 10px;

  &.strobe {
    -webkit-animation: strobe 0.3s linear 3;
    animation: strobe 0.3s linear 3;
  }
}

.homepage {
  #navbar-anonymous {
    margin-right: 0;
  }

  #navbar-login {
    padding-right: 15px;
  }
}

@keyframes strobe {
  0% { background: none; }
  50% { background: rgba(255, 255, 255, 0.15); }
  0% { background: none; }
}

@-webkit-keyframes strobe {
  0% { background: none; }
  50% { background: rgba(255, 255, 255, 0.15); }
  0% { background: none; }
}

#navbar-logged-in {
  margin-left: 0;
  padding: 0;
  list-style-type: none;
  text-align: center;
  cursor: pointer;
  position: relative;
}

.flex-vertical-align {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
}

.dropdown {
  position: relative;

  &.expanded {
    z-index: 999;

    .dropdown-content {
      z-index: 999;
    }
  }

  .dropdown-toggle {
    padding: 10px;
    position: relative;
    color: white;
    text-decoration: none;
    opacity: 0.65;
    cursor: pointer;
    top: 0;
    .transition;

    border-top: 1px solid rgba(0, 0, 0, 0);

    &:hover {
      border-radius: 1px;
      opacity: 1;
    }

    .icon-arrow-down {
      opacity: 1;
      position: relative;
      top: -2px;
      margin: 0 0 0 3px;
      width: 10px;
    }
  }

  &.expanded .dropdown-toggle,
  &:hover.expanded .dropdown-toggle {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background-color: rgba(0, 0, 0, 0.1);
    opacity: 1;
  }

  .dropdown-content {
    background-color: white;
    display: none;
    text-align: left;
    color: black;
    position: absolute;
    overflow: auto;
    max-height: ~"calc(100vh - 85px)";
    min-width: 185px;
    top: 43px;
    right: 0;
    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.24);

    ul {
      list-style-type: none;
      margin: 0;
      padding: 0;

      a {
        text-decoration: none;
        color: rgba(0, 0, 0, 0.6);
        display: block;
        padding: 11px 12px;
        width: 100%;
        box-sizing: border-box;

        &:hover {
          background-color: rgba(0, 0, 0, 0.05);
        }
      }
    }

    p {
      margin: 0;
      padding: 0;
    }
  }
}

// Locale Dropdown Menu
#navbar-locale {
  ul {
    margin: 12px 0;
    padding: 0 14px;
    -webkit-column-count: 2;
    -moz-column-count: 2;
    column-count: 2;
    -webkit-column-gap: 10px;
    -moz-column-gap: 10px;
    column-gap: 10px;

    a {
      padding: 11px 12px 11px 28px;
      -webkit-column-break-inside: avoid;
      break-inside: avoid;
      display: table; // This one simple hack for Firefox

      &.selected {
        background-image: ~"url(/img/icon/checkmark-black.svg)";
        background-repeat: no-repeat;
        background-position: 10px center;
        background-size: 12px;
      }

      &:hover {
        background-color: rgba(0, 0, 0, 0.05);
      }
    }
  }
}

// User menu dropdown
#navbar-logged-in {
  .dropdown-toggle {
    padding-left: 45px;

    .avatar {
      border-radius: 50%;
      width: 25px;
      height: 25px;
      position: absolute;
      top: 8px;
      left: 10px;
      border: solid 1px rgba(255, 255, 255, 0.2);
    }
  }

  .dropdown-content {
    li {
      &:last-child {
        border-top: 1px solid #e9e9e9;
      }

      a {
        img {
          padding-right: 10px;
          width: 16px;
          height: 16px;
          opacity: 0.6;
          position: relative;
          top: 2px;
        }
      }
    }
  }
}
